package cn.itcast.hotel.controller;

import cn.itcast.hotel.pojo.PageResult;
import cn.itcast.hotel.pojo.RequestParams;
import cn.itcast.hotel.service.IHotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @description:
 * @author: HotelController
 * @time: 2022/6/15
 */
@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Autowired
    private IHotelService hotelService;

    @PostMapping(value = "/list",name = "es查询方法")
    public PageResult search(@RequestBody RequestParams params) throws Exception {
        return hotelService.search(params);
    }

    @PostMapping(value = "/filters",name = "显示过滤条件的方法")
    public Map filters(@RequestBody RequestParams params) throws Exception {
        return hotelService.filters(params);
    }
}
